<h2 class="title"><%= @worker.artist_name %></h2>
<div class="content"> <!-- Content start -->
<p id="notice"><%= notice %></p>

<p>
  <b>Vor und Nachname:</b>
  <%= @worker.name %>
</p>

<p>
  <b>Künstlername:</b>
  <%= @worker.artist_name %>
</p>

<p>
  <b>Email:</b>
  <%= @worker.email %>
</p>

<p>
  <b>Telefon:</b>
  <%= @worker.mobile %>
</p>
<% if @worker.routes.size > 0 %>
<p><b>Geschraubte Routen:</b></p>
<table>
  <tr>
    <th>Name</th>
    <th>Geschraubt</th>
    <th>Grad</th>
    <th>Umlenker</th>
    <th>Farbe</th>
    <th>Bauarbeiter</th>
    <th>Eingebort</th>
    <th>Kommentare</th>
    <th></th>  
    <th></th>
    <th></th>
  </tr>

<% @worker.routes.each do |route| %>
  <tr>
    <td><%= route.name %></td>
    <td><%= route.build %></td>
    <td><%= route.grade.grade %></td>
    <td><%= route.chain.number %></td>
    <td><%= route.color.name %></td>
    <td><%= route.workers.collect{|x| x.name}.join(", ") %></td>
    <td><%= route.existent ? "Ja" : "Nein" %></td>
    <td><%= route.rework ? "Ja" : "Nein" %></td>
    <td><%= route.comments.length > 0 ? route.comments.length : "Keine" %></td>
    <td><%= link_to 'Anzeigen', route %></td> 
    <td><% if @user.is_admin? || @user.is_creator?(route) %><%= link_to 'Editieren', edit_route_path(route) %><% end %></td> 
    <td><% if @user.is_admin? %><%= link_to 'Loeschen', route, :confirm => 'Are you sure?', :method => :delete %><% end %></td>
   </tr>
<% end %>
</table>
<% end %>

<% if @user.is_admin? %>
  <%= link_to 'Editieren', edit_worker_path(@worker) %> |
<% end %>
<%= link_to 'Zurück', workers_path %>
</div>
